import { Component, OnInit, ElementRef, Renderer2 } from '@angular/core';
import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import 'rxjs/add/operator/toPromise';
import { Router } from '@angular/router';
import { AuthService } from '../core/service/auth/auth.service';
import { HttpClient } from '@angular/common/http';

@Component({
	selector: 'app-main',
	templateUrl: './main.component.html',
	styleUrls: ['./main.component.scss']
})
export class MainComponent implements OnInit {

	constructor(private router: Router) { }
	/**
	   * @description 验证完成，登录main函数模块,目前仅作为跳转使用
	   */
	loginOut() {
		this.router.navigate(['login']);
	}
	/**
	 * @description 跳转函数
	 * @param route 要跳转的路由
	 */
	goToRoute(route: any, info?) {
		if (info) {
			this.router.navigate([route], {
				queryParams: {
					infoMessage: info
				}
			});
		} else {
			this.router.navigate([route]);
		}
	}
	ngOnInit() {
	}

}
